﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/SiteAdmin.Master" AutoEventWireup="true"  CodeBehind="AgrupacionesListado.aspx.cs" Inherits="WebApplication1.Admin.AgrupacionesListado" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"  Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPanel" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxCallback" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxLoadingPanel" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script language="javascript">
    function confirmEditAspx() {
        var counter = ASPxGridViewAgrupaciones.GetSelectedRowCount();

        if (counter > 1) {
            counter = 0;
            alert("Debe seleccionar un solo registro");
            return (false);
        }
        else if (counter == 1) {
            counter = 0;
            return (true);
        }
        else if (counter == 0) {
            counter = 0;
            alert("Debe seleccionar al  menos un registro");
            return (false);
        }
    }
				
    </script>
    <table style="width: 100%;">
        <tr>
            <td>
                <table>
                    <tr>
                        <td>
                            <dx:ASPxButton ID="btnNuevo" runat="server" Text="NUEVO" Theme="SoftOrange" 
                                OnClick="btnNuevo_Click">
                            </dx:ASPxButton>
                        </td>
                        <td>
                            <dx:ASPxButton ID="btnActualizar" runat="server" Text="MODIFICAR" 
                                Theme="SoftOrange" OnClick="btnActualizar_Click">
                                <ClientSideEvents Click="function(s, e) {return confirmEditAspx(); }" />
                            </dx:ASPxButton>
                        </td>
                        <td>
                            <dx:ASPxButton ID="btnEliminar" runat="server" Text="ELIMINAR" 
                                Theme="SoftOrange">
                                <ClientSideEvents Click="function(s, e) {return confirmEditAspx();}" />
                            </dx:ASPxButton>
                          
                        </td>
                        <td>
                            <dx:ASPxButton ID="btnPublicar" runat="server" Text="PUBLICAR" 
                                Theme="SoftOrange" onclick="btnPublicar_Click">
                               <ClientSideEvents Click="function(s, e) { Callback.PerformCallback();  LoadingPanel.Show(); }" />
                            </dx:ASPxButton>
                          
                        </td>
                    </tr>
                </table>
            </td>
            
        </tr>
        <tr>
            <td >
                <dx:ASPxGridView ID="ASPxGridViewAgrupaciones" runat="server"  ClientInstanceName="ASPxGridViewAgrupaciones"
                    AutoGenerateColumns="False" KeyFieldName="AAD_ID" Width="100%" 
                    ClientIDMode="AutoID" Theme="Office2003Silver">
                                                <Columns>
                                                    <dx:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0">
                                                    </dx:GridViewCommandColumn>
                                                    <dx:GridViewDataTextColumn Caption="Nombre" FieldName="AAD_NOMBRE" 
                                                        VisibleIndex="2">
                                                        
                                                    </dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataTextColumn Caption="ID" FieldName="AAD_ID" VisibleIndex="1" 
                                                        Width="1px">
                                                    </dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataTextColumn Caption="Departamento" VisibleIndex="6" 
                                                        FieldName="DEPARTAMENTO">
                                                    </dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataTextColumn Caption="Municipio" VisibleIndex="7" 
                                                        FieldName="MUNICIPIO">
                                                    </dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataTextColumn Caption="Correo" FieldName="AAD_CORREO" 
                                                        VisibleIndex="3">
                                                    </dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataTextColumn Caption="Dirección" FieldName="AAD_DIRECCION" 
                                                        VisibleIndex="4">
                                                    </dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataTextColumn Caption="Telefono" FieldName="AAD_TELEFONO" 
                                                        VisibleIndex="5">
                                                    </dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataTextColumn Caption="Tipo" FieldName="ATA_NOMBRE" 
                                                        VisibleIndex="8">
                                                    </dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataTextColumn Caption="Estado" FieldName="AAD_ESTADO" 
                                                        VisibleIndex="9">
                                                    </dx:GridViewDataTextColumn>
                                                </Columns>
                                                <Settings ShowFilterRow="True" />
                                                <Settings ShowFilterRow="True"></Settings>
                                            </dx:ASPxGridView>
                           </td>
        </tr>
     
    </table>
</asp:Content>
